
SET( LUA_STATE_H config.h luaState.h
			)
SET( LUA_STATE_SRC ./src/luaState.cpp)


INCLUDE_DIRECTORIES(  ${LUAEx_SOURCE_DIR} )
INCLUDE_DIRECTORIES(  ${LUA_INCLUDE_DIR} )
INCLUDE_DIRECTORIES(  ${MYLIB_DIR} )
INCLUDE_DIRECTORIES(  ${SOL2_INCLUDE_DIR} )

INCLUDE_DIRECTORIES(  ${Boost_INCLUDE_DIR} )
INCLUDE_DIRECTORIES(  ${MYLIB_LOG_INCLUDE_DIR} )

set(LUA_STATE_ALLFILES ${LUA_STATE_H} ${LUA_STATE_SRC})

if(LUA_STATE_STATIC_LIB)
	ADD_LIBRARY(luaState STATIC ${LUA_STATE_ALLFILES})
else(LUA_STATE_STATIC_LIB)
	ADD_LIBRARY(luaState SHARED ${LUA_STATE_ALLFILES})
    if(WIN32)
        add_definitions( -DLUA_STATE_DLL -DluaState_EXPORTS)
    endif(WIN32)
endif(LUA_STATE_STATIC_LIB)


add_definitions(-DUNICODE -D_UNICODE)

#if(WIN32 OR APPLE)
    target_link_libraries(luaState ${LUA_LIBRARY} )
    target_link_libraries(luaState ${Boost_FILESYSTEM_LIBRARY} ${Boost_SYSTEM_LIBRARY}
    							   ${Boost_REGEX_LIBRARY})
    target_link_libraries(luaState ${MYLIB_LOG_LIBRARY})

#endif()

SET_TARGET_PROPERTIES(luaState PROPERTIES PREFIX "")
collect_library(luaState)
